package com.gitee.feizns.explore.data_structure.tree.cus;

/**
 * @author feizns
 * @since 2019/11/25
 */
public interface Node<N extends Node, K extends Comparable<K>, V> {

    default int cmp(Node<N, K, V> node) {
        return key().compareTo(node.key());
    }

    default N node() {
        return (N) this;
    }

    K key();

    void key(K k);

    V val();

    void val(V v);

    N left();

    void left(N left);

    N right();

    void right(N right);

}

